home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 412_01 / src / list / listnode.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-27  |  925 b   |  73 lines

  1. #include "list.h"
  2.  
  3. int LIST_NODE_::destroy = NODEALLOC;
  4.  
  5.  
  6. LIST_NODE_::LIST_NODE_()
  7. {
  8.     data = NULL;
  9.     next = NULL;
  10.     prev = NULL;
  11. }
  12.  
  13.  
  14. LIST_NODE_::LIST_NODE_(VOBJECT_ &obj)
  15. {
  16.     data = &obj;
  17.     next = NULL;
  18.     prev = NULL;
  19. }
  20.  
  21.  
  22. LIST_NODE_::LIST_NODE_(VOBJECT_ &obj, LIST_NODE_ *list, LIST_NODE_ *list2)
  23. {
  24.     data = &obj;
  25.     next = list;
  26.     prev = list2;
  27. }
  28.  
  29.  
  30. LIST_NODE_::~LIST_NODE_()
  31. {
  32.     if (destroy == DEALLOC)
  33.         delete(data);
  34. }
  35.  
  36.  
  37. void LIST_NODE_::setdata(VOBJECT_ &obj)
  38. {
  39.     delete(data);
  40.     data = &obj;
  41. }
  42.  
  43.  
  44. void LIST_NODE_::setnext(LIST_NODE_ *list)
  45. {
  46.     next = list;
  47. }
  48.  
  49.  
  50. void LIST_NODE_::setprev(LIST_NODE_ *list)
  51. {
  52.     prev = list;
  53. }
  54.  
  55.  
  56. VOBJECT_ *LIST_NODE_::getdata() const
  57. {
  58.     return(data);
  59. }
  60.  
  61.  
  62. LIST_NODE_ *LIST_NODE_::getnext() const
  63. {
  64.     return(next);
  65. }
  66.  
  67.  
  68. LIST_NODE_ *LIST_NODE_:: getprev() const
  69. {
  70.     return(prev);
  71. }
  72.  
  73.